package com.cm.caseManagement.service.impl;

import com.cm.caseManagement.dao.CmApplyAuditRecordMapper;
import com.cm.caseManagement.pojo.entity.CmApplyAuditRecord;
import com.cm.caseManagement.service.ICmApplyAuditRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cm.caseManagement.utils.DateUtils;

import java.util.List;

/**
 * 申报审核记录Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-05
 */
@Service
public class CmApplyAuditRecordServiceImpl implements ICmApplyAuditRecordService
{
    @Autowired
    private CmApplyAuditRecordMapper cmApplyAuditRecordMapper;

    /**
     * 查询申报审核记录
     *
     * @param id 申报审核记录主键
     * @return 申报审核记录
     */
    @Override
    public CmApplyAuditRecord selectCmApplyAuditRecordById(Long id)
    {
        return cmApplyAuditRecordMapper.selectCmApplyAuditRecordById(id);
    }

    /**
     * 查询申报审核记录列表
     *
     * @param cmApplyAuditRecord 申报审核记录
     * @return 申报审核记录
     */
    @Override
    public List<CmApplyAuditRecord> selectCmApplyAuditRecordList(CmApplyAuditRecord cmApplyAuditRecord)
    {
        return cmApplyAuditRecordMapper.selectCmApplyAuditRecordList(cmApplyAuditRecord);
    }

    /**
     * 新增申报审核记录
     *
     * @param cmApplyAuditRecord 申报审核记录
     * @return 结果
     */
    @Override
    public int insertCmApplyAuditRecord(CmApplyAuditRecord cmApplyAuditRecord)
    {
        cmApplyAuditRecord.setCreateTime(DateUtils.getNowDate());
        return cmApplyAuditRecordMapper.insertCmApplyAuditRecord(cmApplyAuditRecord);
    }

    /**
     * 修改申报审核记录
     *
     * @param cmApplyAuditRecord 申报审核记录
     * @return 结果
     */
    @Override
    public int updateCmApplyAuditRecord(CmApplyAuditRecord cmApplyAuditRecord)
    {
        cmApplyAuditRecord.setUpdateTime(DateUtils.getNowDate());
        return cmApplyAuditRecordMapper.updateCmApplyAuditRecord(cmApplyAuditRecord);
    }

    /**
     * 批量删除申报审核记录
     *
     * @param ids 需要删除的申报审核记录主键
     * @return 结果
     */
    @Override
    public int deleteCmApplyAuditRecordByIds(Long[] ids)
    {
        return cmApplyAuditRecordMapper.deleteCmApplyAuditRecordByIds(ids);
    }

    /**
     * 删除申报审核记录信息
     *
     * @param id 申报审核记录主键
     * @return 结果
     */
    @Override
    public int deleteCmApplyAuditRecordById(Long id)
    {
        return cmApplyAuditRecordMapper.deleteCmApplyAuditRecordById(id);
    }
}
